package com.starmobi.sz.widget;

import com.starmobi.sz.core.EmbellishManager;
import com.starmobi.sz.entry.StyleEntry;
import com.starmobi.sz.utils.StyleUtils;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

public class SMTextView extends TextView{
	private EmbellishManager em;
	
	public SMTextView(Context context, AttributeSet attrs) {
		this(context, attrs, -1);
	}

	public SMTextView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		em = EmbellishManager.getInstance();
		String name = attrs.getAttributeValue(null, "smstyle");
		StyleEntry e = em.getStyleEntry(name);
		StyleUtils.setTextStyle(this, e);
	}
	
	

	public void bindData(TextE data) {
		setText(data.text);
		
	}
	
	public static class TextE{
		public String text;
	}	
	
	public static class TextP{
		public String text;
	}	
}



